-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[12.0][FIX] base_jsonify: In odoo 12, Date and Datetime fields values are d… #1711
Conversation
…atetime object Convert fields.Date and fields.Datetime values to string when serializing to json
187130d
to
560ba5b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM
/ocabot merge patch |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at feae1f6. Thanks a lot for contributing to OCA. ❤️ |
elif field_type == "date": | ||
value = fields.Date.to_string(value) | ||
elif field_type == "datetime": | ||
value = fields.Datetime.to_string(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to be compliant with ISO 8601 here.
Date is ok, but date_time defined here https://github.com/odoo/odoo/blob/12.0/odoo/tools/misc.py#L568
is with a space as separator between dates and time. Plus it's lacking timezone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lmignon have you seen this comment? Sounds important to me too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbidoul Yes I see it, I'll provide a new PR to fix this.
…atetime objects
Convert fields.Date and fields.Datetime values to string when serializing to json